Skip to content

fix(lint)!: os validate refuses an option label in a flow filter, edge condition or decision branch - #37491

Merged
os-zhuang merged 5 commits into
mainfrom
claude/issue-36964-flow-option-label-filters
Nov 26, 2026
Merged

os-zhuang merged 5 commits into
mainfrom
claude/issue-36964-flow-option-label-filters

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #36964

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37504

维护者速读

  • 用户能看到什么变化:搭建者在流程的查询过滤、分支条件或判断节点里把下拉字段写成选项的显示名(如 'Closed Lost')时,校验和保存现在会直接报错并给出应写的存储值;以前流程照常"成功"却什么都没做。
  • 为什么做:属于流程搭建期校验这一族,替写流程的搭建者(包括 AI)挡住"写了显示名、匹配不到任何记录、却报成功"的静默失效。
  • 出错会怎样:这是一次收紧——以前能保存的这类流程,下次以启用状态保存或构建时会被拒绝并提示应写的值;过滤条件可改用表达式写法绕过,分支条件只能改成存储值;撤回本改动即恢复原样。
  • 要你做什么:无

What changes

flow-condition-option-label used to read one position: a record-change start condition. The same mistake, a select field compared with an option's label while the row stores the option's value, also sits in three other places, and nothing reported it there. A flow filter is handed to the data engine as written (ADR-0061 D4 resolves labels on the query surfaces, never inside an authored flow), so the label matches no row and the run still reports success.

The rule now also reads, at error (its existing severity):

  • Query filter operands: every node type whose config.filter the spec's expression ledger marks filterOperands (get_record, update_record, delete_record), at any region depth, plus a time-relative start's timeRelative.filter. An operand counts when it is a field's implicit equality, its $eq / $ne comparand or a member of its $in / $nin list, at the top level or under $and / $or / $not. The walk is the spec's own flowFilterOperands. The finding sits at the operand's path (flows[0].nodes[1].config.filter.$or[0].stage.$in[1]) and says "matches no record", or "excludes no record" for an excluding operand.
  • Edge conditions and decision branches (conditions[].expression), in every graph of the flow, against the rows the condition can name: the trigger record on a record-change or time-relative flow (record.F, previous.F, and a bare F only when no flow variable, node id or screen field of that name shadows it), and the row a single-row get_record step (limit absent or 1, literal objectName) bound to its outputVariable (deal.F). A variable that anything else in the flow also binds is not judged.

Not judged: a CEL value envelope, a variable or {{ }} comparand, a string carrying a brace (a template or a query placeholder), a picklist field, a nested-relation condition, ordering and text operators.

BREAKING: accept-set narrowing, shipped as minor. A flow that validated and published on main with one of these shapes is refused now, by os validate / lint / compile / build and at its next active publish. The schema is unchanged and stored flows are not rewritten or refused at boot. FROM → TO: filter: { stage: 'Closed Lost' } → filter: { stage: 'closed_lost' }; deal.stage == 'Closed Lost' → deal.stage == 'closed_lost'. A filter operand that really means the label writes a CEL value envelope (filters only; an edge or decision condition has no escape). ADR-0087: not-required (already-registered publish-refuses-flows-that-save-and-do-not-run), and that entry's surface now names the edge condition, the decision branch and the filter operand beside the start condition.

A rebound trigger root is not the trigger row. When the flow itself binds record or previous (a step's outputVariable, a loop's iteratorVariable, an assignment target, a declared variable), that root is dropped from the trigger reader: record.F after the binding is another row's field.

Rule id. One existing id, no new one. The filter operand goes to flow-condition-option-label and not to flow-node-write-unknown-option, because the write rule's verdict is "the record validator refuses the write (invalid_option) and the step fails". That is false for a filter: nothing refuses a filter operand, the step succeeds on nothing. validate-flow-node-writes.ts gains a comment that says so and no code. authoring-rules.ts, rule-explanations.ts and index.ts are untouched, so no registry or wiring change is needed.

Severity. error at every new position, the start condition's severity, decided by the #5762 question in the trigger-readiness header: is this stack enough to know? It is. The label, the field's inline options and the object are all in the stack, and nothing installed changes what the row stores. A filter that really means to find rows still holding a label (a clean-up after the options changed) writes the operand as a CEL value envelope, which is not judged. The changeset says this.

flow-select-options.ts: optionLabelComparisons takes an optional FieldReads (the roots a read is spelled under, whether a bare read counts, and which names shadow it). Its default builds the same regular expression as before, so the start condition reads exactly what it read. A new optionLabelOperands(filter, options) reads filters.

Tests

New describe in flow-publish-checks-second-batch.test.ts (the shared harness for these ids), 14 cases, head 7093e46
  • refused: a label in a get_record filter (path, severity, exact hint); update_record $eq; delete_record $or with an $in member and a multiselect; $ne says "excludes no record"; a filter inside a loop body; a time-relative timeRelative.filter.
  • refused: a decision edge deal.stage == 'Closed Lost' over a get_record outputVariable: 'deal' (a string, and a CEL envelope with in [...]); an edge on a record-change flow reading record.stage; a decision node's conditions[0].expression; a bare stage on a record-change flow.
  • silent: the value; a CEL envelope operand; a '{{wanted_stage}}' operand; an envelope $in member; a picklist field; a nested relation; $gt; a variable comparand; a {{ }} comparand; a get_record with limit: 5; a templated objectName; an output variable also declared in variables; a bare read on a manual flow; a bare read shadowed by a variable.
  • operators: $not over $ne (matches no record), $nin (excludes no record), $and.
  • regions: an edge inside a loop body (flows[0].nodes[5].config.body.edges[0].condition) and a decision branch inside a parallel branch (...config.branches[0].nodes[0].config.conditions[0].expression).
  • trigger rows: a time-relative flow's record.stage, and previous.stage on a record-change flow.
  • silent: record rebound by a get_record outputVariable, a loop iteratorVariable and an assignment, where 'Closed Lost' is a label on the trigger object's stage and a value on the other object's stage (control with an unrelated binder: reported); a variable two get_record steps bind to different objects; a variable shadowed by a node id and by a screen field; a bare read shadowed by a node id and by a screen field.
  • os validate (runAuthoringRules('validate')) reports it, and the runtime publish gate refuses both an edge flow and a filter flow write.
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/flow-publish-checks-second-batch.test.ts
 Test Files  1 passed (1)
      Tests  49 passed (49)
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2
 Test Files  236 passed (236)
      Tests  9675 passed (9675)
pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/migrations
 Test Files  5 passed (5)
      Tests  201 passed (201)
node scripts/check-adr-0087-registration.mjs --base origin/main   exit 0 (not-required (already-registered))
node scripts/check-changeset-no-major.mjs --base origin/main      exit 0
node scripts/check-empty-changeset.mjs --base origin/main         exit 0
pnpm --filter @objectstack/spec run check:spec-changes            exit 0
pnpm --filter @objectstack/spec run check:upgrade-guide           exit 0
pnpm --filter @objectstack/cli exec vitest run --project integration test/migrate-meta-engine-guidance.test.ts
 Test Files  1 passed (1)
      Tests  3 passed (3)
pnpm --filter @objectstack/lint typecheck            exit 0 (tsc --noEmit + check:test-typecheck OK, debt unchanged)
eslint --no-inline-config (the edited .ts files)      exit 0
Ablations: one per new read site, through scripts/ablation-replace.mjs (anchor hit, blob moved, restored blob equals HEAD)
read site mutation result
CRUD filter walk FILTER_NODE_TYPES guard turned into an unconditional continue 5 failed / 39 passed
sweep filter the timeRelative.filter branch made unreachable 1 failed / 43 passed
edge conditions the holder.edges loop made unreachable 4 failed / 40 passed
decision branches the decision guard made always-skip 1 failed / 43 passed
get_record row reader the readers.push for a bound row removed 3 failed / 41 passed
rebound trigger root (second round) roots no longer filtered by the bound names 1 failed / 48 passed: the rebound-record case

The first attempt at the CRUD-filter ablation replaced the guard with a bare continue;, which already appeared in the file 17 times. The tool refused it because the replacement count did not rise by one, and nothing ran. It was redone with a distinct replacement, and that run is the row above.

Acceptance notes

  • os explain flow-condition-option-label still says "why a start condition compares option values" and describes the start condition only. rule-explanations.ts is held by an open PR and fenced off this card. Follow-up reported to the seat.
  • skills/objectstack-automation/SKILL.md §4 says "A label in a filter or an edge condition is never checked: it silently matches nothing". This PR makes that sentence false. skills/** is governed and fenced off this card. Follow-up reported to the seat.
  • Deliberately not covered: a time-relative start's own config.condition, a node-level config.condition on non-start nodes, NODE_ID.record.F reads, a loop iterator over a list get_record, and a field of a related object (nested relation). Each needs its own row-typing decision.
  • A readonly select is judged here, as the start-condition half already judges it (the changeset says so too). The write rule skips readonly because the validator judges such a value by shape only. A row of a readonly select could hold a non-option code, but an option label is not something the platform writes.
  • Runtime publish gate: it subtracts the baseline's findings, so a stored active flow carrying one of these keeps being served. Its next active save is refused.

Read first

  1. packages/lint/src/validate-flow-trigger-readiness.ts, optionLabelsBeyondStart: the row-variable typing (single-row get_record, ambiguity drop, bare-read shadowing). This is where a false positive would come from.
  2. packages/lint/src/flow-select-options.ts, optionLabelOperands: the operand path parsing (combinators, operator set, list members).
  3. packages/lint/src/flow-select-options.ts, readOf: the default must stay byte-identical to the old start-condition expression.

Verification

Two minutes: pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/flow-publish-checks-second-batch.test.ts. Expect Tests 49 passed (49), with the 14 cases under "flow-condition-option-label past the start condition (#36964)" green.


Generated by Claude Code

…itions and decision branches

Claude-Session: https://claude.ai/code/session_01Utp6CY2uhJ1AYNPw5TUSVS
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/lint, @objectstack/spec, touching 20 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/lint/src/validate-flow-node-writes.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/actions-as-tools.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/ai/agents.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/ai/connect-mcp.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/ai/index.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/ai/natural-language-queries.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/ai/tools.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/api/index.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/automation/flows.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/automation/jobs.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/data-modeling/queries.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/deployment/cli.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/getting-started/build-with-claude-code.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/kernel/runtime-services/examples.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))

⛔ 7 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/releases/v17/17-5.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/releases/v17/17-7.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/releases/v17/index.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/releases/v18/18-0.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/releases/v18/18-1.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))
  • content/docs/releases/v18/18-3.mdx (via get_record (literal, a string literal in optionLabelsBeyondStart))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/lint/src/validate-flow-node-writes.ts) — pages documenting those are invisible to this run
  • 5 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 0b1411d4a7aa6eb5880625a7cfa42276d8626824 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 019095fdff731f7e957d2116ffe4df874509056e — the merge of head 7093e465ece700be57375a8a77bb37deec69cb5c into base 0b1411d4a7aa6eb5880625a7cfa42276d8626824, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 019095fdff731f7e957d2116ffe4df874509056e && git checkout 019095fdff731f7e957d2116ffe4df874509056e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0b1411d4a7aa6eb5880625a7cfa42276d8626824 7093e465ece700be57375a8a77bb37deec69cb5c && git checkout -B drift-repro 0b1411d4a7aa6eb5880625a7cfa42276d8626824 && git merge --no-ff 7093e465ece700be57375a8a77bb37deec69cb5c

node scripts/docs-audit/affected-docs.mjs --json 0b1411d4a7aa6eb5880625a7cfa42276d8626824

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 0b1411d4a7aa6eb5880625a7cfa42276d8626824 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 4e9c077 · 2026-11-26T09:26Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 4e9c077b1cf03c0573b5509b1bfef517fb6fea92
Local-runs: none

PR #37491 (card #36964), declaration face. Read: the card body and its four comments (two triage notes, the claim 7186576390, the os-dev report 7187822605), follow-up card #37504, the PR body, the net diff against main (5 files, +528/−12) and the check-runs on the head (57 success, 11 skipped, 0 failed). Nothing was built or run; every statement about behaviour below is from reading the code.

① Derived judgments

  • Accept set of os validate / os lint / os compile / os build and of the runtime publish gate: NARROWED. The PR declares it unchanged. Wrong. flow-condition-option-label stays error and now fires at five positions it never read: get_record / update_record / delete_record filter operands, timeRelative.filter operands, edge condition, decision conditions[].expression. A flow that validated and published on main is refused on this head. The changeset says so itself ("an active flow write carrying one of these is refused there too"), and so does the PR body's maintainer summary.
  • Public surface of @objectstack/lint: unchanged. Right. flow-select-options.ts is imported only by the two validator modules and is re-exported by no entry (index.ts, runtime.ts and rule-explanations.ts are untouched). FieldReads, TRIGGER_RECORD_READS and optionLabelOperands are module-internal. No yes arm is owed for exports.
  • Rule id: right. One existing id, no new one. The filter operand belongs to flow-condition-option-label and not flow-node-write-unknown-option: the write rule's verdict is a validator refusal (invalid_option), and nothing refuses a filter operand.
  • Start-condition arm: unchanged. Right. With the default TRIGGER_RECORD_READS, readOf builds the same expression as on main (optional record. / previous. root, then the field, then the same lookahead).
  • Resolution parity with the existing arm: holds. Every new arm reads options through the same indexSelectOptions (served objects, tied fields dropped, picklist fields skipped, a label that is also a value never reported). Per shape:
    • nested $and / $or / $not groups: walked by the spec's own flowFilterOperands; the prefix parser accepts any nesting and flips negated per $not;
    • lookups: a nested-relation condition is not judged (the outer key has no options; a deeper path under a select field fails the operator check);
    • multi-select: judged as a label that no stored code equals; $in / $nin members judged one by one;
    • dynamic values: a CEL envelope, a non-string operand and any string holding a brace are skipped; a condition's variable or template comparand is not a quoted label;
    • get_record rows: only limit absent or 1, which matches the executor's findOne branch (a truthy limit above 1 is the list branch).
  • Throw on malformed input: none found. Every member access is guarded; collectFlowGraphs hands out record members only; flowFilterOperands is cycle-safe.
  • False positives: one found, S1 below. The rest of the cases asked about (option value equal to its label, variable or template values, formula expressions) are silent by construction.

Findings:

  • M1 (must-fix) — the declaration is a false no and the level is one step low. The diff narrows a published accept set at error, so it owes:

    • Clause-②: no (narrowing) in the PR body and the changeset (no export is added, so not yes);
    • Metadata-protocol: narrowed (a value an author could write is now refused);
    • '@objectstack/lint': minor, not patch (AGENTS.md Post-Task Checklist step 3: a kind other than none takes at least minor);
    • a **BREAKING** banner with the FROM → TO mapping (filter: { stage: 'Closed Lost' } → { stage: 'closed_lost' }; deal.stage == 'Closed Lost' → deal.stage == 'closed_lost') and the CEL-envelope escape, plus ! in the title;
    • an ADR-0087 disposition marker in the changeset. The fitting one is not-required (already-registered publish-refuses-flows-that-save-and-do-not-run), with that entry's surface extended: today it says "a start condition that compares a select field with one of its option labels";
    • a PR-body Skills-docs: follow-up #37504 line, owed by any kind other than none.

    Precedent on main, all four the same shape:

    • .changeset/35143-flow-publish-checks-second-batch.md introduced this very rule: minor, fix(lint)!, (narrowing), narrowed, BREAKING, registered entry.
    • .changeset/36237-hop-list-equality.md is the exact analogue, an existing refusal extended to one more site: minor, (narrowing), narrowed, BREAKING, not-required (already-registered …) with the entry's surface extended.
    • .changeset/34776-publish-checks-build-probes.md and .changeset/36167-cel-list-equality-refused.md: the same.

    Counter-precedent: none found. The @objectstack/lint patch + Metadata-protocol: none changesets on main that mention a refusal are warnings (lint: warn when a permission set's View All / Modify All re-opens a field another set hides, and steer high-sensitivity fields to requiredPermissions (step 2 of #34365) #36052, 同一条记录在电脑整页、右侧预览、手机上的标题和主要动作不一样(HotCRM 线索:标题一处是全名、两处是「全名 - 公司」;主按钮一处是确认线索、两处是转化线索) #36202), wording (a record-triggered flow that a parent also starts as a subflow is judged as if record were its trigger row: the value-envelope date-text refusal reads the parent's record with the child's field types #34694, Formula returnType percent: the lint return-type list still names five types, and the record header chip and grid footer summary do not treat a percent-returning formula as a percentage #35734) or the removal of a false positive (After #36425: a default / OBJECT.create form opened by name from a form-type action is flagged "internal" (lint + Studio rail), and stale resolveFormViewLayout comments remain #36545). None widens an error rule's coverage.

    The green Check Changeset and ADR-0087 gates do not contradict this: they read the declaration as written and cannot judge its direction.

  • S1 (should-fix) — a rebound record / previous is still read as the trigger row. optionLabelsBeyondStart builds shadowed for BARE reads only; the roots record and previous are never dropped. The row-variable loop skips a get_record whose outputVariable is record, but the trigger reader still judges record.F against the trigger object. So a flow that binds record to another object's row (get_record outputVariable: 'record', a loop iteratorVariable: 'record', an assignment) is refused when its condition compares a literal that is a label on the trigger object's field and a value on the other object's same-named field (status: Open as a label on one, a plain-string option on the other). A valid flow is refused at error. Low probability; the fix is to drop a root that collectFlowVariableNames reports as bound. No test covers it.

  • S2 (should-fix) — four new read paths have no test.

    • An edge or decision branch inside a region (loop body, parallel branch): graphHolder and the nested path text are exercised by nothing; the edge and decision ablations hit the top-level graph only.
    • $not, $nin and $and: the negated parity ($not over $ne) and two of the four equality operators are unpinned.
    • A condition on a time-relative flow's trigger record (sweptObject as triggerObject), and previous.F.
    • The ambiguity drop when two get_record steps bind one variable to different objects, and the node-id and screen-field shadows.

    What is covered: each of the six positions has a refused case; the silent controls sit on the get_record filter and on the edge condition, which share code with the other positions.

  • N1 (nit) — top-level node indices can shift on a malformed flow. The flow handed to collectFlowGraphs has nodes: recordsOf(flow.nodes), so a non-record member ahead of a container renumbers the top-level index in graph.path, and graphHolder then walks the AUTHORED list with it: the wrong holder, or none. A map-form nodes resolves to no holder. No throw; a missed or misplaced finding on input the schema refuses anyway.

  • N2 (nit) — the readonly select reading is in the PR body only. A row of a readonly select is judged by shape, so it can hold a non-option string. The changeset should say the field is still judged here, and that an edge or decision condition has no envelope escape (only a filter operand does).

  • N3 (nit) — label drift. The optionLabelsBeyondStart docblock calls itself "(1-iii)"; its call site is "1-iv", and 1-iii is the start-condition block.

② Semver level

Clause-②: the PR body and the changeset both read Clause-②: no with Metadata-protocol: none, on a patch. Wrong on all three; see M1. Owed: Clause-②: no (narrowing), Metadata-protocol: narrowed, minor, BREAKING banner, FROM → TO, ADR-0087 marker.

Two consequences for the seat:

  • The corrected declaration moves the PR to the narrowing face, which is owed at CONTRACT_REVIEW_TIER with a ④ design judgment over the whole non-prose diff. This record is rendered at TIER_DEFAULT on the declaration face, as briefed. It cannot be the PASS of the corrected head.
  • Extending the ADR-0087 entry edits packages/spec/src/migrations/entries/semantic/18.publish-refuses-flows-that-save-and-do-not-run.ts and the generated registry. That is outside the claim's file surface and is a published-spec path, so the seat widens the fence or rules another disposition.

③ Boundary flags

Implemented-by: claude/issue-36964-flow-option-label-filters
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 4e9c077b1cf03c0573b5509b1bfef517fb6fea92
REWORK — L1, seat repo:objectstack#5. Contract record 7188130381 reads FAIL on M1, the declaration. The code is sound: every new arm resolves options through the same indexSelectOptions as the start-condition arm, a label that is also a value is never reported, and no throw path was found.

  1. Shape: open draft against main, 5 files (+528/−12), Fixes #36964, declared Clause-②: no, Metadata-protocol: none, @objectstack/lint patch. Not governed by path. 57 success, 11 expected skips, 0 failed.
  2. Premise: extending flow-condition-option-label at error severity to get_record / update_record / delete_record filters, time-relative filters, edge conditions and decision conditions[].expression makes os validate and the publish gate refuse flows they accepted. That is a narrowing.
  3. Owed before ACCEPT:
    • M1, the declaration.
      • Change it to Clause-②: no (narrowing) and Metadata-protocol: narrowed, with '@objectstack/lint': minor, a ! in the title, and a **BREAKING** banner with FROM → TO, on both the PR body and the changeset.
      • The precedent is uniform: .changeset/35143-flow-publish-checks-second-batch.md introduced this rule exactly that way, and .changeset/36237-hop-list-equality.md is the same shape (an existing refusal extended to more sites).
      • ADR-0087 disposition: not-required (already-registered publish-refuses-flows-that-save-and-do-not-run), with that entry's surface text extended beyond "a start condition".
      • Seat ruling on the fence: packages/spec/src/migrations/entries/semantic/18.publish-refuses-flows-that-save-and-do-not-run.ts (and registry.ts if regenerated) joins the claim. The area amends the claim on flows: an option label in a get_record / update_record filter or a decision edge condition silently matches nothing, and os validate says nothing #36964 citing this comment.
      • Add Skills-docs: follow-up #37504 to the PR body.
    • S1. A record / previous rebound by a get_record outputVariable, a loop iterator or an assignment is still read as the trigger row. That can refuse a valid flow when the literal is a label on the trigger object and a value on the other object's same-named field. Either stop judging once the name is rebound, or add a test pinning the current reading and name it in the changeset.
    • S2. Add tests for four untested read paths:
      • an edge or decision branch inside a region;
      • $not / $nin / $and and the negation parity;
      • a time-relative trigger-record condition and previous.F;
      • the two-reader ambiguity drop and the node-id / screen-field shadows.
    • The delta is a narrowing, so the same reviewer reads it at CONTRACT_REVIEW_TIER with a ④ design judgment. This record cannot serve as that head's PASS.
  4. Accepted deviations (nits, record only):
    • N1: top-level index shift on a malformed flow, with no throw.
    • N2: put the readonly select reading and the no-envelope-escape on edge and decision conditions in the changeset; ride M1.
    • N3: the "(1-iii)" / "1-iv" label drift.
  5. Out of scope and where it went: flow-condition-option-label now reads filters and edge conditions: the automation skill's trap sentence and the os explain text still describe the start condition only #37504 carries the automation skill's trap sentence (governed) and the os explain text (held by feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422). The ADR-0087 entry text stays in this PR under M1.
  6. Landing terms: ungoverned by path, narrowing face. Owed: M1 to S2 closed, required contexts green, a same-head delta PASS at CONTRACT_REVIEW_TIER and an ACCEPT. Then o5-P lands it with --land. A narrowing owes the dogfood battery pinned to the head if label-write --land asks for it.

…r row; pin regions, operators and shadows

Claude-Session: https://claude.ai/code/session_01Utp6CY2uhJ1AYNPw5TUSVS
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot changed the title fix(lint): os validate refuses an option label in a flow filter, edge condition or decision branch fix(lint)!: os validate refuses an option label in a flow filter, edge condition or decision branch Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 7093e465ece700be57375a8a77bb37deec69cb5c
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.publish-refuses-flows-that-save-and-do-not-run.ts + packages/lint/src/validate-flow-trigger-readiness.ts, packages/lint/src/flow-select-options.ts, packages/lint/src/validate-flow-node-writes.ts, packages/lint/src/flow-publish-checks-second-batch.test.ts

Delta round on PR #37491 (card #36964), after record 7188130381 (FAIL at 4e9c077b1c) and the seat's REWORK 7188149361. Read: the card thread through the claim amendment 7188149229 and the os-dev report 7190254733, the PR body and title, the net diff against main (6 files, +676/−14), the two-commit delta from the earlier head, and the check-runs on this head. Nothing was built or run; statements about behaviour are from reading the code.

No must-fix, no should-fix.

Earlier findings:

  • M1: closed
  • S1: closed
  • S2: closed
  • N1: open, accepted deviation (seat's REWORK item 4); unchanged on this head
  • N2: closed
  • N3: closed

① Derived judgments

  • Accept set of os validate / lint / compile / build and the runtime publish gate: narrowed, and now declared so. Right. Unchanged in substance from the earlier head: flow-condition-option-label at error on filter operands (get_record, update_record, delete_record, timeRelative.filter), edge conditions and decision branches.
  • One accept-set change inside the delta, a widening back: right. The trigger reader now drops a record / previous root that the flow binds. Flows the earlier head refused on such a root are accepted again. Nothing main accepted is newly refused by the delta.
  • Public surface of @objectstack/lint: unchanged. Right. No entry file is touched; flow-select-options.ts is still re-exported by none.
  • Public surface of @objectstack/spec: one string changed. Right. The entry's surface text only; id, replacement, reason and acceptanceCriteria are untouched. packages/spec/src/migrations/registry.ts is gitignored (.gitignore:68), so no generated artifact is owed in the diff.
  • Start-condition arm: still unchanged. The default TRIGGER_RECORD_READS is not edited; only the reader built for edges and decision branches filters its roots.

② Semver level

Clause-②: no (narrowing), with Metadata-protocol: narrowed and Skills-docs: follow-up #37504, on the PR body and the changeset alike. Right: an accept set narrows, no export is added.

  • '@objectstack/lint': minor: right for a narrowed kind.
  • '@objectstack/spec': patch: right. Spec ships a changed prose string and no protocol change of its own; .changeset/35143-flow-publish-checks-second-batch.md paired lint minor with spec patch the same way.
  • Title fix(lint)!:, a **BREAKING** banner, FROM → TO for the filter and the condition, the one-line fix, and the envelope escape stated as filters only: all present in the changeset and the PR body.
  • ADR-0087 marker not-required (already-registered publish-refuses-flows-that-save-and-do-not-run) with its reason: present, the same disposition .changeset/36237-hop-list-equality.md took for an existing refusal extended to more sites.
  • Gate verdicts on this head: Check Changeset run 139839481919 (started 10:16:09Z, after the body edit) is a success; see ③ for the earlier run.

③ Boundary flags

  • Stale red on the head, for the seat. Check-runs read from the API: 59 success, 13 skipped, 1 failure. The failure is Check Changeset run 139838894975, started 10:15:06Z. The same check's later run 139839481919 on the same head is a success. The dev's account (the push-time run read the round-1 PR body) fits the two start times; I did not read the job log. The landing rule asks for every check green, so the failed run is re-run or superseded before --land; it is not a contract finding.
  • Dogfood battery pin. The report's dogfood_battery opens with 7093e465e, a 9-hex prefix of this head, not the 40-hex sha. label-write --land reads a 7 to 40 hex prefix and matches it against the head by prefix (BATTERY_SHA_SHAPE, at.startsWith), so the gate will read it as this head. It reports 487 files and 4129 tests passed, none failed, lock verdict exit 0. Whether the run was full is the L1 checklist's to confirm.
  • Dev deviation 1 (a signature trailer in an HTML comment at the end of the PR body, required by the relay): no contract effect; line 1 is still Fixes #36964.
  • Dev deviation 2 (@objectstack/spec patch added): accepted; see ②.
  • Dev deviation 3 (the root is also dropped for a declared flow variable, a node id or a screen field named record / previous): accepted. It can only silence a finding, and the changeset lists the rebound root under "Not judged".
  • Dev deviation 4 (the PR body's ablation table keeps round-1 totals on the five older rows): prose only.
  • open_questions: none this round. Both round-1 questions stay answered A, carried by flow-condition-option-label now reads filters and edge conditions: the automation skill's trap sentence and the os explain text still describe the start condition only #37504, and the Skills-docs: line now names it.
  • Out-of-scope, positions left unjudged: unchanged, accepted as before.
  • The claim amendment fenced the entry file in; authoring-rules.ts, rule-explanations.ts, index.ts and skills/** are still untouched.
  • Security: not security-touching; no hunk reads or changes authentication, permissions, sharing or secrets.
  • SQL push-down: not applicable; the diff issues no query.
  • Author: objectstack-fleet[bot].

④ Design judgment

The entry (hits). The edit is the right shape.

  • It changes surface alone, inside the existing sentence for flow-condition-option-label: "a start condition, an edge condition or a decision branch that compares a select field with one of its option labels, or a get_record / update_record / delete_record or timeRelative filter operand that is one".
  • Sentence against code: the three condition positions and the four filter positions are exactly what optionLabelsBeyondStart and the start-condition block read. The count "Seven author-time flow errors" still holds, since no rule id is added.
  • replacement ("compare the option value, not its label") and reason ("a label comparison is never true, because the row stores the value") still read true for a filter operand. acceptanceCriteria ("os validate reports none of the seven errors") covers the new positions without an edit.
  • The doors the entry names (the runtime publish gate, os validate / lint / compile / build) are the doors the rule runs at; the harness pins runAuthoringRules('validate') and runRuntimeAuthoringRules for both an edge flow and a filter flow.
  • First consumer: the upgrade guide and os migrate meta read the entry as text. No conversion exists or is owed: which option a label means is the author's choice.

The narrowing itself. It makes a silent no-op loud; it takes no working capability away.

  • A label in a flow filter or condition never matched a stored value: the engine hands both through as written (the card measured it on three shapes).
  • The one use it does remove is a filter meant to find rows that literally hold the label text. The changeset names it and gives the CEL value envelope as the way to write it.
  • An edge or decision condition has no such escape, and the changeset says so. A readonly select, whose rows are judged by shape and so can hold a non-option string, is the case where that bites; it is declared, and it is the start condition's existing behaviour.

The rebound-root fix (validate-flow-trigger-readiness.ts). It covers every path named in round 1, and I could not break it.

  • shadowed is collectFlowVariableNames plus the screen field names. That collector reads every node's outputVariable, iteratorVariable, indexVariable and errorVariable, all three assignment shapes, declared variables and node ids, across every region graph. So a get_record outputVariable, a loop iterator and an assignment are all caught, at any depth.
  • With both roots dropped, readOf falls to the bare-only expression; with one dropped, the other stays. A bare F keeps its own shadow check and is still read as the flattened trigger field, which is what the run seeds.
  • A get_record bound to record is not picked up as a row variable either (the loop skips those two names), so such a flow gets no record.F finding from any reader.
  • New false negatives: a flow that binds record or previous anywhere loses that root everywhere, including conditions that run before the binding, and including a binding to a row of the same object. Both are named in the docblock and the changeset ("a record / previous root the flow rebinds itself"). None beyond those.
  • Tests: three binders silent, with a control that reports when the binder names another variable; the dev's ablation of the filter turned one case red.

The other implementing files. flow-select-options.ts and validate-flow-node-writes.ts are byte-identical to the earlier head; the round-1 reading stands (operand path parsing, the unchanged default expression, no throw path). The harness gained five cases that pin each path S2 named: $not over $ne, $nin, $and; an edge in a loop body and a decision branch in a parallel branch, with their nested paths; a time-relative trigger record and previous.F; the two-object ambiguity drop; the node-id and screen-field shadows for a row variable and for a bare read.

Nits, none with an effect on correctness or the contract:

  • N1 (nit) — unchanged: top-level node indices can shift on a malformed flow; no throw. Accepted deviation.
  • N4 (nit) — the rebound-root cases bind record only; previous takes the same filter and has no case of its own.

Implemented-by: claude/issue-36964-flow-option-label-filters
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 7093e465ece700be57375a8a77bb37deec69cb5c
ACCEPT — L1, seat repo:objectstack#5

  1. Shape:
    • Open draft against main, Fixes #36964, title fix(lint)!.
    • Declarations: Clause-②: no (narrowing), Metadata-protocol: narrowed, Skills-docs: follow-up #37504.
    • Changesets: @objectstack/lint minor, @objectstack/spec patch, with a BREAKING banner (FROM → TO) and the marker not-required (already-registered publish-refuses-flows-that-save-and-do-not-run).
    • Not governed by path. The ADR-0087 entry edit is fenced in by claim amendment.
  2. Premise:
    • flow-condition-option-label now also covers these positions: get_record / update_record / delete_record filters, time-relative filters, edge conditions and decision conditions[].expression. They are at error severity, with no new rule id.
    • The entry's surface now names exactly those positions.
    • A record / previous root that the flow rebinds is no longer judged. The new false negatives this opens are declared.
  3. Gates:
    • Delta record 7190372362 (same reviewer, CONTRACT_REVIEW_TIER, verified on the transcript) reads PASS. M1, S1, S2, N2 and N3 are closed.
    • Dogfood battery pinned to 7093e465e (os-dev report 7190254733): 487 files / 4129 tests, 0 failed.
    • Checks at 7093e465ec: 59 success, 13 expected skip, and one stale red. The red is Check Changeset 139838894975 (10:15:06Z), which read the round-1 body before the body patch landed. The later Check Changeset run 139839481919 on the same head is a success.
  4. Accepted deviations:
    • N1: top-level index shift on a malformed flow.
    • N4: the rebound-root cases bind record only. previous takes the same filter.
    • The signed HTML-comment trailer on the PR body, which the relay requires.
  5. Out of scope and where it went: flow-condition-option-label now reads filters and edge conditions: the automation skill's trap sentence and the os explain text still describe the start condition only #37504 (the automation skill trap sentence; the os explain text held by feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422).
  6. Landing terms: ungoverned, a narrowing at CONTRACT_REVIEW_TIER, with a same-head PASS, this ACCEPT and the battery pinned. Area o5-P lands with --land. If the land gate reads the stale Check Changeset red, re-run that one job first (it is superseded, not a finding).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS

Re-run reason (zone o5-P) · 2026-11-26T11:10Z · head 7093e465ece700be57375a8a77bb37deec69cb5c
Check Changeset push run 45799553660 (job 139838894975, started 2026-11-26T10:15Z) read the round-1 PR body (Clause-②: no, Metadata-protocol: none) before the body patch landed; the edited-event run 139839481919 on this same head read the patched body and is success. Not a flake and not a defect in the diff: an ordering artefact (push before body patch). The failed job is re-run once so the stale red is superseded before --land; contract delta PASS 7190372362 stands.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS

Landing (zone o5-P) · 2026-11-26T11:12Z · ACCEPT 7190384001 at 7093e465ece700be57375a8a77bb37deec69cb5c

Probe Reading
check-governed-merges.mjs --pr 37491 NOT governed; +676/-14 ≤ 3000
landing-k.mjs --pr 37491 OK — K = 2 < 15; no new locale pack under a label PR; no shared book moved
Dogfood battery 7093e465e · os-verify-lock VERDICT command-exit 0 · Test Files 487 passed, 3 skipped · Tests 4129 passed, 68 skipped · 0 failed (os-dev report 7190254733)

Stale red, stated: Check Changeset push run 45799553660 (job 139838894975) read the round-1 body before the patch; the edited-event run 139839481919 on this head is success. The relay cannot re-run it (pr-automation.yml is outside its re-run list), and Check Changeset is not in REQUIRED_CONTEXTS, so it does not gate the queue. Reason on record in the re-run note on this PR.
State: ready + auto-merge armed; #36964 closes on merge (Fixes).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 11:13
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

维护者速读

  • 改了什么:流程发布检查 flow-condition-option-label(error 级,不新增规则 id)的覆盖面扩大了。原来只查启动条件,现在也查 get_record / update_record / delete_record 的筛选值、timeRelative 筛选、连线条件和 decision 分支:拿选项「标签」去和选择字段比较时会报错。ADR-0087 条目 publish-refuses-flows-that-save-and-do-not-run 只改了 surface 一句话,与代码逐项对上。流程自己重新绑定的 record / previous 根不再判断,由此带来的新漏报已在 changeset 的「不判断」里列出。
  • 为什么:flows: an option label in a get_record / update_record filter or a decision edge condition silently matches nothing, and os validate says nothing #36964。拿标签比较永远不成立,因为行里存的是值,这类流程上线后静默不生效。
  • 风险:属于收窄(Clause-②: no (narrowing),Metadata-protocol: narrowed)。以前能发布的、在这些位置拿标签比较的流程,现在会被拒,改法是一行:换成选项值。lint 升 minor,spec 升 patch,标题 fix(lint)!,有 BREAKING 横幅(FROM → TO),并带 ADR-0087 已登记标记。复核没有 must-fix 或 should-fix。dogfood 全套钉在本 head:487 个文件、4129 个测试,0 失败。
  • 为什么交给你:按 2026-11-19 在 governance: the guard scripts join the governed register, .claude/** lands by declared rule-change, and a narrowed spec change lands only by the maintainer #35321 上的 narrowed-spec 裁定,收窄声明的 PR 按 Tier H 落地。Governed Surface Guard(run 45808642353)因此把它移出了队列。check-governed-merges 只看路径,判成了不受管,席位落地时漏看了这一点。区域在 11:13Z 的落地(7190441059)作废,区域不会重新入队。
  • 要你做什么:批准,并由授权账号入队。席位 ACCEPT 7190384001,契约复核 PASS 7190372362,Head-sha 7093e465ece700be57375a8a77bb37deec69cb5c。

席位意见:ACCEPT。收窄是有意的、已声明的,迁移路径是一行。剩下的 N1、N4 两条 nit 不影响正确性;skills 文案由 #37504 跟进。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 227e952 Nov 26, 2026
78 of 79 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-36964-flow-option-label-filters branch November 26, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flows: an option label in a get_record / update_record filter or a decision edge condition silently matches nothing, and os validate says nothing

3 participants